<include file='./header' />
<meta http-equiv="Content-Type" content="text/html" charset="utf-8" />
<script type="text/javascript" src="__ROOT__/js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">
var totalMoney = 0;

$(document).ready(function () {
    getAdviser();
    getPropertyList();

    changedapanclass($("#seldapanclass").val());
    changeuserclass($("#seluserclass").val()); 
    changeuserclass(1);
    changeuserclass(2);
    changeuserclass(3);
    changeuserclass(4);
<<<<<<< .mine
=======

>>>>>>> .r283
});


function getPropertyList(){
    $.ajax({  
                type: "post",  
                url: "__URL__/getPropertyList",
                dataType: 'json', 
                beforeSend: function(XMLHttpRequest){
				
                },  
                success: function(json){
                  var data = eval('('+json+')');
                  var str = "";  
                  var v1,v2,v3,html;
                  $.each(data, function(i,val){      
                          v1 = i; 
                          v2 = val[0][0]; 
                          v3 = val[0][1];
                          /*if(val['zrsy'] == null){
                              v3 = "-";
                          }else{
                              v3 = val['zrsy'];
                          }*/
                          html = zlshow(v1,v2,v3);
						  $("#tbpackage tbody").append(html);
						  totalMoney +=  parseFloat(v2);
						 // alert(totalMoney);
                  });
<<<<<<< .mine
				  //alert(totalMoney);
=======
				  //alert(totalMoney);
				  if(totalMoney){
>>>>>>> .r283
				  $('#ddTotalMoney').text(totalMoney);
				  }else
				  {
				  $('#ddTotalMoney').text(0);
				  $('#spanjrbh').text(0);
				  $('#spanuserxjday1').text(0);
				  $('#spanuserzjday1').text(0);
				  $('#spanusergpday1').text(0);
				  $('#spanuserllday1').text(0);
				  
				  }
				  
				  
   
                } 
        })
    
	
}

function zlshow(v1,v2,v3){
     var str = "";
     str += "<tr>\r\n";
     str += "   <td>"+ v1 +"</td>\r\n";
     str += "   <td class=\"align-right\">"+ v2 +"</td>\r\n";
     str += "   <td class=\"align-right\">"+ v3 +"</td>\r\n";
     str += " </tr>\r\n";
    return str;
}

$(showsheet('11','22','上证综指','深成指数'));
function showsheet(jsonname1,jsonname2,cname1,cname2) {
    tj();onloadImg();
    var seriesOptions = [],
        yAxisOptions = [],
        seriesCounter = 0,
        //names = ['goog','appl'], //json文件的名字
        //names = ['grail','sczs'],
        //cNames = ['华夏大盘','深成指数'], //显示出来的中文名称
        names = [jsonname1,jsonname2],
        cNames = [cname1,cname2], //显示出来的中文名称
        types =['spline','areaspline'], //图表类型：线形图、面积图
        zIndexs=[2,1], //显示层级顺序：线形图在上、面积图再下
        colors = Highcharts.getOptions().colors;
    
    var path = "__ROOT__/json/";
    //var path = "http://localhost:17539/json/3/";
    $.each(names, function(i, name) {
        $.getJSON(path+ name.toLowerCase() +'.json',    function(result) {
            var data = result.data;
            seriesOptions[i] = {
                name: cNames[i],
                data: data,
                type: types[i],
                zIndex:zIndexs[i]
            };
            // As we're loading the data asynchronously, we don't know what order it will arrive. So
            // we keep a counter and create the chart when all the data is loaded.
            seriesCounter++;

            if (seriesCounter == names.length) {
                createChart();
            }
        });
    });

    // create the chart when all data is loaded
    function createChart() {

        $('#container').highcharts('StockChart', {
            title:{
                text:"您的金融资产走势图",
                style: { "color": "#ff6c60", "fontSize": "16px" ,"fontFamily":"微软雅黑"}
                },
            colors: [  "#ff6c60","#dce9ee","#41cac0","#78cd51"],
            chart: {},          
            rangeSelector: {selected: 4 },
            yAxis: {
                labels: {
                    formatter: function() {
                        return (this.value > 0 ? '+' : '') + this.value + '%';
                    }
                },
                plotLines: [{
                    value: 0,
                    width: 2,
                    color: 'silver'
                }],
                gridLineColor: '#f0f0f0'
            },
            
            plotOptions: {
                series: {                   
                    compare: 'percent'                  
                }
                
            },
            
            tooltip: {
                pointFormat: '<span style="color:{series.color}">{series.name}</span>: <b>{point.y}</b> ({point.change}%)<br/>',
                valueDecimals: 3,
                borderColor: 'gray'
            },
            series: seriesOptions,
            rangeSelector: {
                enabled: false,
                selected: 1,
                buttons: [{
                    type: 'day',
                    count: 3,
                    text: '3天'
                },{
                    type: 'month',
                    count: 1,
                    text: '1个月'
                }, {
                    type: 'month',
                    count: 6,
                    text: '6个月'
                }, {
                    type: 'year',
                    count: 1,
                    text: '一年'
                }],
                inputDateFormat: '%Y-%m-%d',
                inputEditDateFormat: '%Y-%m-%d',
                buttonTheme: { // styles for the buttons
                    r: 5,
                    width:40,
                    states: {
                        hover: {
                            fill: '#ec6459',
                            style: {
                                color: 'white'
                            }
                        },
                        select: {
                            fill: '#ff6c60',
                            style: {
                                color: 'white'
                            }
                        }
                    }
                },
                
                inputBoxWidth: 100,
                inputBoxHeight: 17
                
            },
             
            xAxis: {
                type: 'datetime',
                dateTimeLabelFormats: {
                    second: '%Y-%m-%d<br/>%H:%M:%S',
                    minute: '%Y-%m-%d<br/>%H:%M',
                    hour: '%Y-%m-%d<br/>%H:%M',
                    day: '%Y<br/>%m-%d',
                    week: '%Y<br/>%m-%d',
                    month: '%Y-%m',
                    year: '%Y'
                }
            },
            legend: {
                enabled: true
            }
        });
    }
}
var big=1;

function getAdviser(){     
        $.ajax({  
        type: "post",  
        url: "__URL__/GetAdviser",
        dataType: 'json',
        data: {v:big},  
        beforeSend: function(XMLHttpRequest){
        },  
        success: function(json){
           if(json != null){
               var imgurl="__ROOT__"+ json.smallimg;
               $("#imghead").attr('src',imgurl);
               $("#pname").text(json.advisername);
               $("#pdesc").text(json.desc);
               big++;   
           }else{
               big=1;
               getAdviser();
           }
        } 
    }) 
    
}

function changedapanclass(obj){
    /*if(obj==1){
        showsheet('szzz','szzz','上证综指','上证综指');
    }
    if(obj==2){
        showsheet('szzz','sczs','上证综指','深成指数');
    }
    if(obj==3){
        showsheet('szzz','hs300','上证综指','沪深300');
    }
    if(obj==5){
        showsheet('szzz','hj','上证综指','黄金');
    }*/
    $.ajax({  
        type: "post",  
        url: "__URL__/getuserdapanrate",
        dataType: 'json',
        data: {type:obj},  
        beforeSend: function(XMLHttpRequest){
        },  
        success: function(json){
            $("#spandapanday3").html(gethighslows(json.day3));
            $("#spandapanday30").html(gethighslows(json.day30));
            $("#spandapanday180").html(gethighslows(json.day180));
            $("#spandapanday365").html(gethighslows(json.day365));
        } 
    })  
}


function changeuserclass(obj){
   if(obj==1){
        
        //showsheet('szzz','szzz','华夏大盘','上证综指');
    }
        $.ajax({  
        type: "post",  
        url: "__URL__/getuserjingrongrate",
        dataType: 'json',
        data: {type:obj},  
        beforeSend: function(XMLHttpRequest){
        },  
        success: function(json){
            $("#spanuserday3").html(gethighslows(json.day3));
            $("#spanuserday30").html(gethighslows(json.day30));
            $("#spanuserday180").html(gethighslows(json.day180));
            $("#spanuserday365").html(gethighslows(json.day365));
            if(obj == 1){
                $("#spanuserxjday1").html(gethighslows(json.day1));
            }else if(obj == 2){
                $("#spanuserzjday1").html(gethighslows(json.day1));
            }else if(obj == 3){
                $("#spanusergpday1").html(gethighslows(json.day1));
            }else if(obj == 4){
                $("#spanuserllday1").html(gethighslows(json.day1));
            }
        } 
    })  
}


function gethighslows(value){
    var str = "";
    if(value > 0){
        str = "<span class='text-danger'>↑ "+ value +"%</span>";
    }else if(value < 0){
        str = "<span class='text-success'>↓ "+ value +"%</span>";
    }else{
        str = "<span>"+ value +"</span>";
    }
    return str;
}




function showdapanrate(obj){
    
    
}

function showjinrongrate(obj){
    
    
}

</script>
</head>
<body>
<!--顶部开始-->
<include file="./top" />
<!--顶部结束-->
<!--左导航开始-->
<include file="./left" />
<!--左导航结束-->

<!--主体开始-->
<div class="main-content">
	<div class="wrapper">
    	<div class="left65 left">
            <!--查看图表-->
            <div class="panel cktb">
            	<div class="panel-body">
                	<!--资产总额-->
                	<div class="tj_total">
                        <dl>
                            <dt>总净值资产</dt>
                            <dd id="ddTotalMoney"></dd>
                        </dl>
                        <dl>
                            <dt>今日变化</dt>
                            <dd><span id='spanjrbh' class="text-danger"></span></dd>
                        </dl>
                    </div>
                    <div class="clear"></div>
                    <!--图表-->
                    <div id="container" class="tb_con" style="width:100%;height:500px"></div>
                    <!--加载中状态-->
                    <div class="tb_onload" style="display:none;">
                    	<div>
                        数据加载中...<br />
                        <img src="__ROOT__/images/onload.gif" />
                        </div>
                    </div>
                    <!--查询条件及统计-->
                    <div class="tj">
                    	<dl class="tj_left">
                        	<dt></dt>
                            <dd>
                                <select class="form-control" name="" id="seluserclass" onChange="changeuserclass(this.value)">
                                  <option value="5">金融总资产</option>
                                  <option value="1">现金</option>
                                  <option value="2">债券</option>
                                  <option value="3">股票</option>
                                  <option value="4">另类投资</option>
                                </select>
                            </dd>
                            <dd>
                            	<select class="form-control" name="" id="seldapanclass" onChange="changedapanclass(this.value)">
                                  <option value="1">上证综指</option>
                                  <option value="2">深成指数</option>
                                  <option value="3">沪深300</option>
                                  <option value="4">债券指数</option>
                                  <option value="5">黄金</option>
                                </select>
                            </dd>
                        </dl>
                    	<dl class="tj_con hover">
                       	    <dt><span class="btn btn-default btn-sm">3天</span></dt>
                            <dd id="spanuserday3"></dd>
                            <dd id="spandapanday3"></dd>
                        </dl>
                        <dl class="tj_con hover">
                        	<dt><span class="btn btn-default btn-sm">1个月</span></dt>
                            <dd id="spanuserday30"></dd>
                            <dd id="spandapanday30"></dd>
                        </dl>
                        <dl class="tj_con hover">
                        	<dt><span class="btn btn-default btn-sm">6个月</span></dt>
                            <dd id="spanuserday180"></dd>
                            <dd id="spandapanday180"></dd>
                        </dl>
                        <dl class="tj_con hover">
                        	<dt><span class="btn btn-default btn-sm">1年</span></dt>
                            <dd id="spanuserday365"></dd>
                            <dd id="spandapanday365"></dd>
                        </dl>
                  </div>
              </div>
            </div>
            <!--财经新闻-->
            <div class="panel cjxw">
            	<div class="panel-head">
                	资产列表
                	<!--<span class="right">[<a href="#" target="_blank">更多</a>]</span>-->
                </div>
                <div class="panel-body">
                    <?php if($zccount>0) {?>
                   <table class="table table-striped" id="tbpackage">
                    	<thead>
                          <tr>
                            <th>分类</th>
                            <th class="align-right">总金额</th>
                            <th class="align-right">昨日收益</th>
                          </tr>
                        </thead>
                        <tbody>
                         
                      </tbody>
                    </table>
                    <?php } else{?>
                        您还没有录入资产
                     <?php }?>
                </div>
          </div>
        </div>
        <div class="right35 right">
        	<!--资产-->
            <div class="panel zc">
            	<div class="panel-head">
                    今日行情
                </div>
                <div class="panel-body">
                    <table class="table">
                      <thead>
                      <tr>
                        <th>上证综指</th>
                        <th>沪深300</th>
                        <th>USD/CNY</th>
                        <th>黄金</th>
                      </tr>
                      </thead>
                      <tr>
                        <td>{$dapanRate['szzz']}</td>
                        <td>{$dapanRate['hs300']}</td>
                        <td>{$dapanRate['USD']}</td>
                        <td>{$dapanRate['hj']}</td>
                      </tr>
                      <tr>
                        <td>{$dapanPrice['szzz']}</td>
                        <td>{$dapanPrice['hs300']}</td>
                        <td>{$dapanPrice['USD']}</td>
                        <td>{$dapanPrice['hj']}</td>
                      </tr>                       
                    </table>
                   
				</div>
            </div>
            <!--金融资产合计-->
            <div class="panel zc">
                <div class="panel-head">
                    金融资产合计
                    <span class="right">102万</span>
                </div>
                <div class="panel-body">
                  <table class="table table-striped">
                        <thead>
                          <tr>
                            <th>分类</th>
                            <th>资金变动</th>
                          </tr>
                        </thead>
                            <tbody>
                          <tr>
                            <td>现金</td>
                            <td id="spanuserxjday1"></td>
                          </tr>
                          <tr>
                            <td>债券</td>
                            <td id="spanuserzjday1"></td>
                          </tr>
                          <tr>
                            <td>股票</td>
                            <td id="spanusergpday1"></td>
                          </tr>
                          <tr>
                            <td>另类投资</td>
                            <td id="spanuserllday1"></td>
                          </tr>
                      </tbody>
                    </table>
                   
                </div>
            </div>
            <!--理财顾问-->
            <div class="panel lcgw">
            	<div class="panel-head">
                	理财顾问
                	<span class="right">[<a href="javascript:" onClick="getAdviser()">下一位</a>]</span>
                </div>
                <div class="media panel-body" style="margin:0">                    
                  <a class="left">
                      <img id="imghead">
                  </a>
                  <div class="media-body">
                      <a href="#" class=" p-head" id="pname"></a>
                      <p id="pdesc"></p>
                  </div>
                  <div class="clear"></div>
                  <div class="tool">
                        <span><a href="javascript:void(0)" class="btn btn-success" data-reveal-id="appointment">预约面谈</a></span>
                        <span><a href="javascript:void(0)" class="btn btn-primary" data-reveal-id="askOnLine">线上咨询</a></span>
               	 	</div>
                </div>
                
            </div>
        </div>
    </div>
</div>
<!--主体结束-->
<!--底部开始-->
<include file="./foot" />
<!--底部结束-->
<!--弹出层开始-->
<div id="appointment" class="reveal-modal panel large">
	<div class="panel-head">
        预约面谈
        <a class="close-reveal-modal close_layer">×</a>
    </div>
    <div class="panel-body">
    	<h2 class="align-center">请提前至少48小时预约</h2>
        <div class="layerForm">
        	<p>
                <label>预约时间：</label>
                <input type="text" id="txtDate" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd H:mm',minDate:'%y-%M-{%d+2}',disabledDates:['....-..-.. 0[0-9]\:..\:..','....-..-.. 1[6-9]\:..\:..','....-..-.. 2[0-3]\:..\:..']})" class="form-control Wdate" name="" placeholder="选择预约时间" />
                <span>（10:00-16:00）</span>
                <span style="display:none;" class="notice_wrong" id="spanDate"></span>
            </p>
            <p>
                <label>您的邮箱：</label>
                <input name="" class="form-control" placeholder="邮箱地址" type="text" id="txtEmail">
                <span style="display:none;" class="notice_wrong" id="spanEmail"></span>
            </p>
            <p>
                <label>您的问题：</label>
                <textarea name="" cols="" rows="" id="txtQuestion" placeholder="填写想咨询的问题"></textarea>
                <span style="display:none;" class="notice_wrong" id="spanQuestion"></span>
            </p>
            <p style="padding-left:20%;">
                <a class="btn btn-danger" type="button" style="width:20%">提 交</a>
                <a class="btn btn-success close-reveal-modal" style="width:20%">取 消</a>
            </p>
            <div class="clear"></div>
        </div>
        <div class="clear"></div>
    </div>
</div>
<div id="askOnLine" class="reveal-modal panel large">
	<div class="panel-head">
        线上咨询
        <a class="close-reveal-modal close_layer">×</a>
    </div>
    <div class="panel-body">
        <div class="layerForm">
        	<p>
                <label>发 件 人：</label>
                <input type="text" class="form-control" name="" placeholder="填写您的邮箱地址" />
                <span style="display:none;" class="notice_wrong" id="spanDate"></span>
            </p>
            <p>
                <label>收 件 人：</label>
                <input name="" class="form-control" value="xingxing@7min.com.cn" type="text" disabled="disabled" >
            </p>
            <p>
                <label>咨询主题：</label>
                <input name="" class="form-control" placeholder="填写您的咨询主题" type="text" >
                <span style="display:none;" class="notice_wrong" id=""></span>
            </p>
            <p>
                <label>咨询内容：</label>
                <textarea name="" cols="" rows="" id="" placeholder="填写您的咨询内容"></textarea>
                <span style="display:none;" class="notice_wrong" id=""></span>
            </p>
            <p style="padding-left:20%;">
                <a class="btn btn-danger" type="button" style="width:20%">发 送</a>
                <a class="btn btn-success close-reveal-modal" style="width:20%">取 消</a>
            </p>
            <div class="clear"></div>
        </div>
        <div class="clear"></div>
    </div>
</div>
<!--弹出层结束-->
</body>
</html>
